Xbasic

MOD Function

Syntax

Remainder as N = MOD(N numerator,N denominator)

Arguments

numerator

Numeric

denominator

Numeric

Description

Returns the integer remainder of one number divided by another.

Discussion

MOD() returns the remainder of the numerator after being divided by the denominator.

Example

mod(8,4) -> 0
mod(9,4) -> 1
mod(4,8) -> 4

Assume that your table has a field, TIMESPENT, that tracks the number of minutes you devote to a project. You want to print a report showing this number in hours and minutes. Define and place two calculated fields, called HOURS and MINUTES. The expression for HOURS is:

int(TIMESPENT/60)

The expression for MINUTES is:

mod(TIMESPENT,60)

See Also